package com.nus.fellowmark.dao;

import com.nus.fellowmark.entity.GradeEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 
 * 
 * @author Chen Ruoyi
 * @email chenruoyisz@gmail.com
 * @date 2023-02-10  
 */
@Mapper
public interface GradeDao extends BaseMapper<GradeEntity> {
	/**
     * select grade by pair Id and rubric Id
     * @param (pairId,rubricId)
     * @return
     */
    @Select("SELECT * FROM grade WHERE pairing_id=#{pairId} AND rubric_id=#{rubricId}")
    GradeEntity selectByPairIdAndRubricId(Integer pairId, Integer rubricId);

    /**
     * select grade by pair Id only
     * @param pairId
     * @return
     */
    @Select("SELECT * FROM grade WHERE pairing_id=#{pairId}")
    List<GradeEntity> selectByPairId(Integer pairId);
}
